package frontend.user.controller;


import com.opensymphony.xwork2.ActionSupport;
import core.address.model.AddressType;
import core.address.model.BasicAddress;
import core.profile.model.BasicProfile;
import core.profile.model.BasicProfileAv;
import frontend.user.dao.EditProfileDao;

public class EditProfileAction extends ActionSupport  {

	private static final long serialVersionUID = -4008768088656606508L;
	private String firstname;
	private String lastname;
	private String mobile;
	private String secondname;
	private String phone;
	private String phonebusiness;
	private String postalcode;
	private String companyname;
	private String aboutus;
	private String gender;
	private String addressLine1;
	private String language;
	private String addressType;
	private String title;
	private Long uuid ;
	private BasicProfile basicProfile;
	private BasicAddress basicAddress;
	private BasicProfileAv basicProfileAv;
	private AddressType addType;
	
	public Long getUuid() {
		return uuid;
	}

	public void setUuid(Long uuid) {
		this.uuid = uuid;
	}
		
	public String getFirstname() {
		return firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}



	public String getLastname() {
		return lastname;
	}



	public void setLastname(String lastname) {
		this.lastname = lastname;
	}



	public String getMobile() {
		return mobile;
	}



	public void setMobile(String mobile) {
		this.mobile = mobile;
	}



	public String getCompanyname() {
		return companyname;
	}



	public void setCompanyname(String companyname) {
		this.companyname = companyname;
	}



	public String getAboutus() {
		return aboutus;
	}



	public void setAboutus(String aboutus) {
		this.aboutus = aboutus;
	}



	public String getGender() {
		return gender;
	}



	public void setGender(String gender) {
		this.gender = gender;
	}



	public String getAddressLine1() {
		return addressLine1;
	}



	public void setAddressLine1(String addressLine1) {
		this.addressLine1 = addressLine1;
	}



	public String getLanguage() {
		return language;
	}



	public String getSecondname() {
		return secondname;
	}

	public void setSecondname(String secondname) {
		this.secondname = secondname;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhonebusiness() {
		return phonebusiness;
	}

	public void setPhonebusiness(String phonebusiness) {
		this.phonebusiness = phonebusiness;
	}

	public String getPostalcode() {
		return postalcode;
	}

	public void setPostalcode(String postalcode) {
		this.postalcode = postalcode;
	}

	public void setLanguage(String language) {
		this.language = language;
	}


	public String getAddressType() {
		return addressType;
	}



	public void setAddressType(String addressType) {
		this.addressType = addressType;
	}



	public String getTitle() {
		return title;
	}



	public void setTitle(String title) {
		this.title = title;
	}



	public BasicProfile getBasicProfile() {
		return basicProfile;
	}



	public void setBasicProfile(BasicProfile basicProfile) {
		this.basicProfile = basicProfile;
	}



	public BasicAddress getBasicAddress() {
		return basicAddress;
	}



	public void setBasicAddress(BasicAddress basicAddress) {
		this.basicAddress = basicAddress;
	}



	public BasicProfileAv getBasicProfileAv() {
		return basicProfileAv;
	}



	public void setBasicProfileAv(BasicProfileAv basicProfileAv) {
		this.basicProfileAv = basicProfileAv;
	}



	public AddressType getAddType() {
		return addType;
	}



	public void setAddType(AddressType addType) {
		this.addType = addType;
	}


	public String editProfile()
	{
		basicProfile = GetDataByEmailId.listProfileById(this.getUuid());
		this.basicAddress = basicProfile.getCurrentAddress();
		return SUCCESS;
	}
	public String execute() throws Exception{
		//Map session = ActionContext.getContext().getSession();
		//session.get("emailId");
		
		//this.basicProfile=GetDataByEmailId.getBasicProfileByEmailId(session.get("emailId").toString());
		//this.basicAddress=GetDataByEmailId.getBasicAddressByEmailId(session.get("emailId").toString());
		this.basicProfile.setCurrentAddress(basicAddress);
		EditProfileDao.editProfile(basicProfile);
		
		return SUCCESS;
	}

}
